import 'dart:convert';

import 'package:enterprise_v6_app/generated/json/base/json_field.dart';
import 'package:enterprise_v6_app/generated/json/ins_task_detail_entity.g.dart';

export 'package:enterprise_v6_app/generated/json/ins_task_detail_entity.g.dart';

@JsonSerializable()
class InsTaskDetailEntity {
  InsTaskDetailEntity();

  factory InsTaskDetailEntity.fromJson(Map<String, dynamic> json) => $InsTaskDetailEntityFromJson(json);
  String? id;
  String? companyCode;
  String? hazardCode;
  String? riskObjectId;
  String? riskObjectName;
  String? riskUnitId;
  String? riskUnitName;
  String? riskEventId;
  String? riskEventName;
  String? riskMeasureId;
  String? riskMeasureDesc;
  String? checkTaskId;

  /// 排查内容
  String? troubleshootContent;
  int? checkCycle;
  String? checkCycleUnit;
  String? workStartTime;

  /// 正常：0；存在隐患：1；未排查：2；其他：3；待排查：4；
  /// 正常：0；存在隐患：1；未排查(漏检)：2；逾期排查(补检)：3(巡检计划台账中)
  int? checkStatus;
  int? allocationId;
  String? allocationName;
  dynamic allocationType;
  dynamic workTypeDicId;
  dynamic taskNum;
  String? checkTime;
  String? checkUserId;

  /// 巡检人
  String? checkUserName;
  dynamic mobileMe;
  dynamic isDefend;
  dynamic dangerInvestigationId;
  dynamic createBy;
  dynamic createById;
  dynamic createByDep;
  dynamic createByMobile;
  String? createDate;
  String? updateBy;
  dynamic updateById;
  String? updateDate;
  String? deleted;

  /// 任务执行状态 0：正常 1：补检 2：容错
  String? isInspection;

  /// 任务结束时间
  String? workEndTime;

  /// 容错截止时间
  String? faultLastTime;

  /// 到期时间
  String? supplementaryInspectionTime;

  dynamic workKind;
  dynamic startRefreshTime;
  dynamic endRefreshTime;

  ///计划名称
  String? planName;

  ///计划名称id
  String? planId;

  /// 巡检描述
  String? inspectionDescription = '';

  /// 巡检照片
  List<String>? inspectionPhotos = [];

  /// 巡检视频[数组]
  List<String>? inspectionVideos = [];

  /// 语音文件列表
  List<String>? patrolVoices = [];

  Map<String, dynamic> toJson() => $InsTaskDetailEntityToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}
